#ifndef _WHILELOOP_
#define _WHILELOOP_

#include "Statement.h"
#include "Expression.h"

class WhileLoop: public Statement
{
public:
    WhileLoop(TreeNode* iCondition, TreeNode* iBody);
    virtual ~WhileLoop();
    virtual void CheckVariables(set<string>& oVariables, string iParentName);
    virtual void CheckFunctionCalls(set<FunctionDefinition*>& iAllFunctions, string iParentName);
    virtual void CheckClassConstructions(set<ClassDefinition*>& iAllClasses, string iParentName);
    virtual void CheckExpressionTypes(map<string, ExpressionType*>& iVarTypes, string iParentName);
    virtual void Accept(GeneralVisitor* iVisitor);
    virtual ReturnStatement* GetFirstReturnStatement();

    TreeNode* GetCondition()    { return fCondition;    }
    TreeNode* GetBody()         { return fBody;         }

private:
    TreeNode* fCondition;
    TreeNode* fBody;
};

#endif
